Skip to content

Conversation

@binno
Copy link
Contributor

@binno binno commented Nov 4, 2025

This adds support for the Svukte extension, which adds support for address-independent latency of user-mode faults to supervisor addresses.

Copy link
Collaborator

@aswaterman aswaterman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ingallsj can I delegate to you to review this, particularly the various cases in check_svukte_qualified?

This adds support for the Svukte extension, which adds support for
address-independent latency of user-mode faults to supervisor addresses.
Copy link
Contributor Author

@binno binno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @aswaterman
Modification by your suggestion has been done.
Many thanks for review

} else if (ext_str == "svinval") {
extension_table[EXT_SVINVAL] = true;
} else if (ext_str == "svukte") {
extension_table[EXT_SVUKTE] = true;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should have a check that XLEN is 64 and issue an error if not.

return !hstatus_hukte;
}

if (((addr >> SYS_MEM_HEADING_BIT) & 0x1)) {
Copy link
Collaborator

@aswaterman aswaterman Nov 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should have assert(proc->get_xlen() == 64) here. Then we can simply write if ((addr >> 63) & 1).

if (((addr >> SYS_MEM_HEADING_BIT) & 0x1)) {
return ((state->v || forced_virt) &&
((proc->get_xlen() == 64) ? ((state->vsatp->read() & SATP64_MODE) == 0) :
((state->vsatp->read() & SATP32_MODE) == 0)));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And then we can get rid of the XLEN=32 stuff here.

#endif

// Svukte extension
#define SYS_MEM_HEADING_BIT 63
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And we can get rid of this, too.

}
}

[[noreturn]] void throw_page_access_exception(bool virt, reg_t addr, access_type type)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename this function to throw_page_fault_exception.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants